<template>
  <el-timeline>
    <el-timeline-item v-for="(item, index) in data" :key="index" :timestamp="`${parseTime(item.traceTime, '{y}-{m}-{d} {h}:{i}')} ${item.contacter}`" placement="top">
      <el-card>
        <h4>{{ item.traceDesc }}</h4>
        <h4 v-if="item.repairContent">{{ `报修内容:${item.repairContent}` }}</h4>
        <p>{{ `发生部门&nbsp;——&nbsp;${item.facilityName ? item.facilityName : '系统'}` }}</p>
      </el-card>
    </el-timeline-item>
  </el-timeline>
</template>

<script>
  import { } from '@/api'
  import { parseTime } from '@/utils'

  export default {
    name: 'circul',
    data() {
      return {
        parseTime,
        visible: false,
        orderCode: '', // 订单号
        data: [
          {
            traceTime: 1632713596905,
            contacter: '王二小',
            traceDesc: '007完成回执确认',
            marker: '',
            facilityName: '上海全流程测试'
          },
          {
            traceTime: 1632713596905,
            contacter: '王二小',
            traceDesc: '007完成回执确认',
            marker: 'ceshi',
            facilityName: ''
          }
        ]
      }
    },
    methods: {
      async open(temp) {
        if (temp) {
          this.orderCode = temp // 父组件传过来的订单号
          // const res = await queryOrderFlowInfo({
          //   orderCode: temp
          // })
          // this.data = res.data
        }
        return new Promise(resolve => {
          this.resolve = resolve
          this.visible = true
        })
      },
      reset() {
        this.visible = false
      }
    }
  }
</script>

<style lang="scss" scoped>
.form {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  & /deep/ .el-form-item {
    width: 48%;
    .el-form-item__content > .el-select {
      width: 100%;
    }
  }
  .block {
    width: 100%;
  }
}
.info-title {
  display: flex;
  align-items: center;
  margin-top: 10px;
  margin-bottom: 20px;
  .title-icon {
    display: inline-block;
    width: 4px;
    height: 18px;
    margin-right: 6px;
    background: $themeColor;
  }
  span {
    font-weight: 700;
    color: $themeColor;
  }
}
</style>
